package com.deke.order.controller;

import com.deke.order.service.QianOrderPayService;
import com.deke.vo.Result;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：Username 刘亦辰（59372312@qq.com）
 * @date ：Created in 2023/1/11 12:59
 * @description：
 * @modified By：
 * @version:
 **/
@RestController
@RequestMapping("/order/pay/")
public class QianOrderPayController {

    @Autowired
    private QianOrderPayService orderPayService;
    
    /**
     * @create by: Username 刘亦辰 
     * @description: 生成订单 
     * @create time: 2023/1/11 17:15
     * @param null 
     * @return :  
     **/
    @PostMapping("/createWeiXin/{id}/{HuiYuanId}")
    public Result createWeiXin(@PathVariable String id,@PathVariable String HuiYuanId){
        return orderPayService.createWeiXin(id,HuiYuanId);
    }

    @PostMapping("/createWeiXin1/{id}/{HuiYuanId}")
    public Result createWeiXin1(@PathVariable String id,@PathVariable String HuiYuanId){
        return orderPayService.createWeiXin1(id,HuiYuanId);
    }
    
    /**
     * @create by: Username 刘亦辰 
     * @description: 查询订单状态 
     * @create time: 2023/1/11 17:15
     * @param null 
     * @return :  
     **/
    @PostMapping("/getPayStatus/{out_trade_no}")
    public Result getPayStatus(@PathVariable String out_trade_no){
        return orderPayService.getPayStatus(out_trade_no);
    }
}